package com.xxg.websocket.utils;

import com.xxg.websocket.server.MySocketServer;

import java.util.Collection;
import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.ConcurrentMap;

/**
 * @描述
 * @创建人 joy_qiu
 * @创建时间 2020-05-21-16:58
 * @修改人和其它信息
 */
public class WebSocketMapUtil {
    public static ConcurrentMap<String, MySocketServer> webSocketMap = new ConcurrentHashMap<>();

     public static void put(String key, MySocketServer myWebSocketServer){
      webSocketMap.put(key, myWebSocketServer);
    }

    public static MySocketServer get(String key){
        return webSocketMap.get(key);
    }

    public static void remove(String key){
        webSocketMap.remove(key);
    }

    public static Collection<MySocketServer> getValues(){
        return webSocketMap.values();
    }
}
